package com.seres.client.model.user;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.seres.client.annotation.TableFieldDefaultValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @description TODO 
 * @className SysUser
 * @author Tan-Bowen
 * @date 2021-08-12 14:41
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel ("sys_user")
@TableName (value ="sys_user")
public class SysUser {

  @TableId(type = IdType.ASSIGN_ID)
  private Long id;

  @ApiModelProperty("用户姓名")
  @TableFieldDefaultValue(value ="''")
  private String name;

  @ApiModelProperty("用户昵称")
  @TableFieldDefaultValue(value ="''")
  private String userName;

  @ApiModelProperty("密码")
  @TableFieldDefaultValue(value ="''")
  private String password;

  @ApiModelProperty("1男 2女")
  @TableFieldDefaultValue(value ="1")
  private Integer sex;

  @ApiModelProperty("用户电话")
  @TableFieldDefaultValue(value ="''")
  private String tel;

  @ApiModelProperty("头像地址")
  @TableFieldDefaultValue(value ="''")
  private String headUrl;

  @ApiModelProperty("最后登录时间")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  private Date lastLoginTime;

  @ApiModelProperty("最后登录ip")
  @TableFieldDefaultValue(value ="''")
  private String lastLoginIp;

  @ApiModelProperty("创建时间")
  @TableFieldDefaultValue(value ="CURRENT_TIMESTAMP")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  private Date createTime;

  @ApiModelProperty("修改时间")
  @TableFieldDefaultValue(value ="CURRENT_TIMESTAMP")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  private Date updateTime;

  @ApiModelProperty("部门id 默认0(无)，1: 超级管理员")
  @TableFieldDefaultValue(value ="0")
  private Long deptId;

  @ApiModelProperty("1启用")
  @TableFieldDefaultValue(value ="0")
  private Integer state;


}
